package com.itc.dispatch.controller;

import com.itc.common.core.domain.R;
import com.itc.dispatch.domain.FlightOperationMonitoring;
import com.itc.dispatch.domain.dto.DisFlightConfigDto;
import com.itc.dispatch.domain.dto.DisFlightSearchValueDto;
import com.itc.dispatch.domain.dto.FieldValueDto;
import com.itc.dispatch.domain.vo.DisFlightConfigVo;
import com.itc.dispatch.domain.vo.FieldVo;
import com.itc.dispatch.service.DisFlightSearchConfigService;
import com.itc.dispatch.service.DisFlightTableConfigService;
import com.itc.dispatch.service.FlightOperationMonitoringService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/flight/config")
@Api(value = "disFlightConfig", tags = "航班运行监控配置管理模块")
public class DisFlightConfigController {

    @Autowired
    private DisFlightTableConfigService disFlightTableConfigService;

    @Autowired
    private DisFlightSearchConfigService disFlightSearchConfigService;

    @Autowired
    private FlightOperationMonitoringService flightOperationMonitoringService;


//
    /**
     * 更新配置
     * @param dto
     * @return
     */
    @ApiOperation(value = "更新配置")
    @PostMapping("/update")
    public R configUpdate(@Validated @RequestBody DisFlightConfigDto dto){
        return disFlightTableConfigService.configUpdate(dto);
    }

    /**
     * 保存/应用配置管理界面信息
     * @return
     */
    @ApiOperation(value = "保存/应用配置管理界面信息")
    @PostMapping("/save/config")
    public R saveConfig(@RequestBody @Validated DisFlightConfigVo dto) throws NoSuchFieldException {
        return disFlightTableConfigService.saveConfig(dto);
    }





}
